#pragma once

#include "types.hpp"
#include <string>
#include <unordered_map>
#include <vector>

namespace perf_boost {
    class PlayerCache {
    private:
        static const std::string CACHE_FILE_NAME;
        std::unordered_map<std::string, uint64_t> nameToGuidMap;
        bool cacheModified;

    public:
        PlayerCache();
        ~PlayerCache();

        bool LoadFromFile();
        bool SaveToFile();
        
        void AddPlayerMapping(const char* playerName, uint64_t guid);
        uint64_t GetGuidForPlayer(const char* playerName);
        bool HasPlayerMapping(const char* playerName);
        
        void PopulateFromPlayerData(const std::vector<PlayerData>& players);
        size_t GetCacheSize() const;
        void Clear();
    };
}